<template>
	<view>
		<u-sticky bgColor="#fff">
			<u-tabs lineColor="#FFB800" :scrollable="false" lineWidth="15" :activeStyle="{
			             color: '#000000',
			             fontWeight: 'bold',
			             transform: 'scale(1.05)'
			         }" :inactiveStyle="{
			             color: '#666666',
			             transform: 'scale(1)'
			         }" :list="list1" @change="tabChage"></u-tabs>
		</u-sticky>
		<view class="mainpadding2">
			<view class="mainpadding_top ffffff radius" v-for="(item,index) in shop">
				<view class="flexbetween">
					<view class="titletext hei_text bold">{{item.name}}</view>
					<view class="huang_text main_size bold" v-if="item.status==0">待稽核</view>
					<view class="lv_text main_size bold" v-if="item.status==1">已通過</view>
					<view class="hong_text main_size bold " v-if="item.status==2">已拒絕</view>
				</view>
				<view class="xiaohui margin_top pdl">上傳時間：{{item.bangdingtime}}</view>
				<view class="xiaohong margin_top" v-if="item.status==2">拒絕理由：{{item.feedback}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				list1: [{
					name:"全部",
					id: 1
				},
				{
					name:"待稽核",
					id: 2
				},
				{
					name:"已通過",
					id: 3
				},
				{
					name:"已拒絕",
					id: 4
				},
				],
				tabsId: 1,
				shop:''
			}
		},
		onLoad(){
			this.get()
		},
		methods: {
			async get(){
				uni.showLoading({
					mask:true,
					title:"請稍後"
				})
				let res = await this.http.request("/api/shop/Shopshenhe", "POST", {
					type:this.tabsId
				})
				uni.hideLoading()
				if (res.code == 1) {
					this.shop= res.data
				} else if (res.code == 0) {
					this.http.toast(res.msg);
				} else {
					this.http.toast('暫無數據');
				}
			},
			tabChage(e) {
				this.tabsId = e.id
				this.shop=''
				this.get()
			},
		}
	}
</script>

<style>

</style>